<%@ page import="registerallocator.Professor" %>



<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'login', 'error')} required">
	<label for="login">
		<g:message code="professor.login.label" default="Login" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="login" required="" value="${professorInstance?.login}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'senha', 'error')} required">
	<label for="senha">
		<g:message code="professor.senha.label" default="Senha" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="password" name="senha" required="" value="${professorInstance?.senha}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'nome', 'error')} required">
	<label for="nome">
		<g:message code="professor.nome.label" default="Nome" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="nome" maxlength="50" required="" value="${professorInstance?.nome}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'mail', 'error')} required">
	<label for="mail">
		<g:message code="professor.mail.label" default="Mail" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="email" name="mail" required="" value="${professorInstance?.mail}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'fone', 'error')} ">
	<label for="fone">
		<g:message code="professor.fone.label" default="Fone" />
		
	</label>
	<g:textField name="fone" pattern="${professorInstance.constraints.fone.matches}" value="${professorInstance?.fone}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'accountExpired', 'error')} ">
	<label for="accountExpired">
		<g:message code="professor.accountExpired.label" default="Account Expired" />
		
	</label>
	<g:checkBox name="accountExpired" value="${professorInstance?.accountExpired}" />
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'accountLocked', 'error')} ">
	<label for="accountLocked">
		<g:message code="professor.accountLocked.label" default="Account Locked" />
		
	</label>
	<g:checkBox name="accountLocked" value="${professorInstance?.accountLocked}" />
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'competencia', 'error')} required">
	<label for="competencia">
		<g:message code="professor.competencia.label" default="Competencia" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="competencia" name="competencia.id" from="${registerallocator.Competencia.list()}" optionKey="id" required="" value="${professorInstance?.competencia?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'cursos', 'error')} ">
	<label for="cursos">
		<g:message code="professor.cursos.label" default="Cursos" />
		
	</label>
	
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'enabled', 'error')} ">
	<label for="enabled">
		<g:message code="professor.enabled.label" default="Enabled" />
		
	</label>
	<g:checkBox name="enabled" value="${professorInstance?.enabled}" />
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'horario', 'error')} ">
	<label for="horario">
		<g:message code="professor.horario.label" default="Horario" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${professorInstance?.horario?}" var="h">
    <li><g:link controller="horarioProfessor" action="show" id="${h.id}">${h?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="horarioProfessor" action="create" params="['professor.id': professorInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'horarioProfessor.label', default: 'HorarioProfessor')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'passwordExpired', 'error')} ">
	<label for="passwordExpired">
		<g:message code="professor.passwordExpired.label" default="Password Expired" />
		
	</label>
	<g:checkBox name="passwordExpired" value="${professorInstance?.passwordExpired}" />
</div>

<div class="fieldcontain ${hasErrors(bean: professorInstance, field: 'turmas', 'error')} ">
	<label for="turmas">
		<g:message code="professor.turmas.label" default="Turmas" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${professorInstance?.turmas?}" var="t">
    <li><g:link controller="turma" action="show" id="${t.id}">${t?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="turma" action="create" params="['professor.id': professorInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'turma.label', default: 'Turma')])}</g:link>
</li>
</ul>

</div>

